package com.dwxt.cdms.controller;

import com.dwxt.cdms.base.Page;
import com.dwxt.cdms.entity.TaskMessage;
import com.dwxt.cdms.service.TaskMessageService;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:消息管理
 * @author chendq
 * @date 2021/10/18
 */
@RequestMapping("/cdms/taskMessage")
@RestController
public class TaskMessageController {

    @Autowired
    private TaskMessageService taskMessageService;

    /**
     * 分页查询
     */
    @RequestMapping("/page")
    public BaseResult page(Page page) {
        return taskMessageService.page(page);
    }

    /**
     * 新增或修改
     */
    @RequestMapping("/add")
    public BaseResult add(TaskMessage taskMessage, BindingResult bindingResult) {
        return taskMessageService.add(taskMessage);
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public BaseResult delete(String id){
        return taskMessageService.delete(id);
    }

}

